<!-- 信息列表组件 <good-list :list="xx"></good-list> -->
<template>
	<view class="good-list">
		<view :id="'good'+good.id" class="good-li" @click="chooseGood(good.id)" v-for="good in list" :key="good.id">
			<!-- <image class="good-img" :src="'http://localhost:9090/'+good.headpic" mode="widthFix"/> -->
			<u-avatar :mode="mode" :size="size" :src="'http://localhost:9090/'+good.headpic" :text="text" :showLevel="showLevel" :showSex="showSex"
				:bgColor='bgColor' class="good-img"></u-avatar>
			<view class="flex-item">
				<view class="good-name">{{good.username}}</view>
				<text class="good-title">来源:{{good.title}}</text>
			</view>
			<view class="flex-button" v-if="good.form_state=='不合适'">
				<u-tag :text="good.form_state" type="error" :shape="shape" :closeable="closeable"
					:mode="mode1" :show="show" :size="size1" />
			</view>
			<view class="flex-button" v-if="good.form_state=='已通过'">
				<u-tag :text="good.form_state" type="success" :shape="shape" :closeable="closeable"
					:mode="mode1" :show="show" :size="size1" />
			</view>
			<view class="flex-button" v-if="good.form_state=='被查看'">
				<u-tag :text="good.form_state" :type="type" :shape="shape" :closeable="closeable"
					:mode="mode1" :show="show" :size="size1" />
			</view>
			<view class="flex-button" v-if="good.form_state=='未处理'">
				<u-tag :text="good.form_state" type="warning" :shape="shape" :closeable="closeable"
					:mode="mode1" :show="show" :size="size1" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			list: {
				type: Array,
				default(){
					return []
				}
			}
		},
		data(){
			return{
				mode: 'circle',
				src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
				text: '', // 优先级比src高
				size: 'large',
				showLevel: false,
				showSex: false,
				bgColor: '#fcbd71',
				text1: '包吃包住', //标签配置
				mode1: 'light',
				type: 'info',
				size1: 'default',
				shape: 'circleLeft',
				closeable: false,
				show: true,
			}
		},
			mounted() {
				console.log()
			},	
		methods:{
			chooseGood(index){
				console.log(index)
					uni.navigateTo({
						url: '/pages/chat/chat-application/chat_list_info/chat_list_info?id='+index,
						animationType: 'fade-in'
					});
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #eeefef;
	}
	.good-list{
		background-color: #ffffff;
		
		.good-li{
			display: flex;
			align-items: center;
			padding: 10upx;
			border-bottom: 1upx solid #eee;
			margin-left: 10upx;
			border-radius: 40upx;
			
			.good-img{
				width: 100upx;
				height: 100upx;
				margin-right: 20rpx;
				
			}
			.btn {
				line-height: 50rpx;
				width: 140rpx;
				border-radius: 26rpx;
				border: 2rpx solid $u-border-color;
				font-size: 26rpx;
				text-align: center;
				color: $u-type-info-dark;
			}
			
			.flex-item{
				flex: 1;
				
				.good-name{
					font-size: 35upx;
					line-height: 40upx;
					height: 80upx;
					margin-bottom: -34upx;
					overflow: hidden;
					font-weight: 600;
					margin-left: 16upx;
				}
				.good-price{
					font-size: 30upx;
					margin-left: 16upx;
					color: red;
				}
				.good-title{
					font-size: 24upx;
					margin-left: 16upx;
					color: gray;
					display: flex;
					margin-bottom: 10upx
				}
				.good-envir{
					display: flex;
					margin-left: 16upx;
					margin-bottom: 10upx;
				}
			}
		}
	}
</style>
